﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using Common.Net.Utilities;

namespace ClearUnit.TestRunners
{
    public static class TypeAttributeHelper
    {
        public static IEnumerable<MethodInfo> GetTestMethods(this Type type)
        {
            var methods = type.GetMethods(BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public);
            return methods.Where(m => m.IsTest());
        }

        public static bool IsExplicit(this Type type)
        {
            return type.HasAttribute<ExplicitAttribute>();
        }
    }
}
